package com.laomou.logdog;


import java.io.FileInputStream;
import java.util.Properties;

public class AdbCommand {
    private String basePath = "";
    private String adb = "adb";

    public AdbCommand() {
        loadAdb();
    }

    public void loadAdb() {
        try {
            Properties p = new Properties();
            p.load(new FileInputStream(".adb"));
            basePath = p.getProperty("ADB_PATH");
        } catch (Exception e) {
            System.err.println("Not find ADB_PATH in file(.adb)");
        }
    }

    public String adbDevices() {
        return basePath + adb + " devices";
    }

    public String adbLogCat(String device, String cmd) {
        return basePath + adb + " -s " + device + " " + cmd;
    }
}
